<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mdsproject/mds_logisticsite/Mds_LogisticSite.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/mdsproject/mds_logisticsite/Mds_LogisticSite.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Mds_LogisticSite",
        setup() {
            const table = ref({
                key: "LogisticSiteId",
                footer: "Foots",
                cnName: "物流点位信息",
                name: "mds_logisticsite/Mds_LogisticSite",
                newTabEdit: false,
                url: "/Mds_LogisticSite/",
                sortName: "LogisticSiteId"
            });
            const editFormFields = ref({"PlantId":"","SiteCode":"","SiteName":"","Enabled":"","Occupied":"","Remarks":""});
            const editFormOptions = ref([[{"dataKey":"BASE_Plant","data":[],"title":"归属工厂","field":"PlantId","type":"select"},
                               {"title":"点位编号","required":true,"field":"SiteCode"},
                               {"title":"点位名称","required":true,"field":"SiteName"}],
                              [{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"switch"},
                               {"dataKey":"enabled","data":[],"title":"是否占用","field":"Occupied","type":"switch"},
                               {"title":"备注","field":"Remarks","colSize":8,"type":"textarea"}]]);
            const searchFormFields = ref({"SiteCode":"","SiteName":"","Enabled":""});
            const searchFormOptions = ref([[{"title":"点位编号","field":"SiteCode","type":"like"},{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"select"},{"title":"点位名称","field":"SiteName","type":"like"}]]);
            const columns = ref([{field:"LogisticSiteId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"PlantId",title:"归属工厂",type:"bigint",bind:{ key:"BASE_Plant",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"SiteCode",title:"点位编号",type:"string",link:true,sort:true,width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"SiteName",title:"点位名称",type:"string",width:150,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Occupied",title:"是否占用",type:"sbyte",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",sort:true,width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",sort:true,width:110,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([  { 
                    cnName: "点位别名",
                    table: "Mds_LogisticSiteAlias",
                    columns: [{field:"LogisticSiteAliasId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"LogisticSiteId",title:"物流点位",type:"bigint",width:110,hidden:true,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"MachineId",title:"物流设备",type:"bigint",bind:{ key:"BASE_Machine_Lgt",data:[]},width:160,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"RealDeviceId",title:"关联数采设备",type:"bigint",bind:{ key:"MDS_RealDevice",data:[]},width:150,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"SiteCodeAlias",title:"点位编号别名",type:"string",width:120,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"ConfirmSiteCode",title:"待命确认点",type:"string",width:120,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:110,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,hidden:true,edit:{type:"textarea"},showOverflowTooltip:true,align:"left"}],
                    sortName: "LogisticSiteAliasId",
                    key: "LogisticSiteAliasId",
                    buttons:[],
                    delKeys:[],
                    detail:null
                                            },                    { 
                    cnName: "上下料点位",
                    table: "Mds_LogisticSiteInout",
                    columns: [{field:"MachineId",title:"生产设备",type:"bigint",bind:{ key:"BASE_Machine_Prd",data:[]},width:180,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"InFlag",title:"上料口",type:"int",bind:{ key:"enabled",data:[]},width:120,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"OutFlag",title:"下料口",type:"int",bind:{ key:"enabled",data:[]},width:120,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"TankInFlag",title:"上料或罐起点",type:"int",bind:{ key:"enabled",data:[]},width:120,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"TankOutFlag",title:"出料或罐终点",type:"int",bind:{ key:"enabled",data:[]},width:120,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:120,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"LogisticSiteInoutId",title:"ID",type:"bigint",width:120,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"LogisticSiteId",title:"物流点位",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"}],
                    sortName: "LogisticSiteInoutId",
                    key: "LogisticSiteInoutId",
                    buttons:[],
                    delKeys:[],
                    detail:null
                                            }]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
